package com.test.restaurant.service;

import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * @author 徒有琴
 */
@EnableDubbo//开启dubbo服务
@SpringBootApplication
@MapperScan(basePackages = "com.test.restaurant.dao")
public class ProviderStarter {
    public static void main(String[] args) {
        SpringApplication.run(ProviderStarter.class, args);
    }

    @Bean(destroyMethod="close")
    public HttpSolrClient solrClient(){
        String url = "http://www.hf1901.com:8983/solr/new_core";
        HttpSolrClient server = new HttpSolrClient.Builder(url).build();
        return server;
    }
}
